#include "DataStructure/Input/Element/CHEXAData.h"

#include <cstddef>
#include <vector>

#include "DataStructure/Common/Id.h"

using namespace SG::DataStructure::FEM;

void CHEXAData::Set8Points (const std::vector<SG::DataStructure::Common::Id>& g)
{
    if (g.size () != 8)
    {
        return;
    }
    for (size_t i = 0; i < 8; ++i)
    {
        m_g[i] = g[i];
    }
}

/// @brief 判断两个CHEXAData数据值是否相同
bool SG::DataStructure::FEM::operator== (const CHEXAData& a, const CHEXAData& b)
{
    if (a.m_id != b.m_id)
    {
        return false;
    }
    if (a.m_pId != b.m_pId)
    {
        return false;
    }
    for (int i = 0; i < 20; ++i)
    {
        if (a.m_g[i] != b.m_g[i])
        {
            return false;
        }
    }
    if (a.m_domainId != b.m_domainId)
    {
        return false;  // NOLINT(readability-simplify-boolean-expr)
    }
    return true;
}